package com.cl.service.impl;

import com.cl.mapper.DeparmentMapper;
import com.cl.pojo.Department;
import com.cl.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class DepartmentServiceImpl implements DepartmentService {

    private DeparmentMapper deparmentMapper;

    public void setDeparmentMapper(DeparmentMapper deparmentMapper) {
        this.deparmentMapper = deparmentMapper;
    }


    @Override
    public List<Department> queryAll(int page, int limit) {
        return deparmentMapper.queryAll(page,limit);
    }

    @Override
    public Department queryByDepartmentname(String departmentname) {
        return deparmentMapper.queryByDepartmentname(departmentname);
    }

    @Override
    public int addDepartment(Department department) {
        return deparmentMapper.addDepartment(department);
    }

    @Override
    public int updateDepartment(Department department) {
        return deparmentMapper.updateDepartment(department);
    }

    @Override
    public List<Department> queryByName(String name) {
        return deparmentMapper.queryByName(name);
    }

    @Override
    public int delById(int id) {
        return deparmentMapper.delById(id);
    }
}
